
get_filename_component(tarName ${CMAKE_CURRENT_SOURCE_DIR} NAME)

add_compile_definitions(appName="${CMAKE_PROJECT_NAME}_${tarName}")
set(qrcs "")
set(images "")
file(GLOB_RECURSE files *.h *.hpp *.cpp *.c)

if (CMAKE_BUILD_TYPE MATCHES "Release")
    file(GLOB_RECURSE qrcs *.qrc)
    set(images ${sharedImageRes})
    add_compile_definitions(qmlPath="qrc:/")
    add_compile_definitions(imgPath="qrc:/image/")
else()
    set(tarName ${tarName}_debug)
    add_compile_definitions(qmlPath="file:///${CMAKE_CURRENT_SOURCE_DIR}/")
    add_compile_definitions(imgPath="file:///${sharedImagePath}/")
endif()
message("shared files ${sharedFiles}")
add_executable(${tarName} ${files} ${qrcs} ${images} ${sharedFiles})
target_include_directories(${tarName} PUBLIC . ${sharedPath})
# target_compile_definitions(${tarName} PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_link_libraries(${tarName} PUBLIC
    Qt::Core
    Qt::Gui
    Qt::Qml
    Qt::Quick
    Qt::QuickControls2
)
